<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>实验室运维文档 | 博客</title><meta name="keywords" content="服务器"><meta name="author" content="小魂"><meta name="copyright" content="小魂"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="引言你是否因为python环境杂乱而苦恼，是否因为程序依赖库的半杯不一样而频繁卸载库，是否因为环境问题不停的切换目录等那么你看完这篇文件就能解决你的这些烦恼，小编来讲解linux下多个python环境应该怎么管理 1：工具安装virtualenv是python开发中一个重要的工具,它可以帮助我们创建一个干净的python解释环境，打开控制台安装virtualenv 1pip install vir">
<meta property="og:type" content="article">
<meta property="og:title" content="实验室运维文档">
<meta property="og:url" content="https://shark-yun.gitee.io/blog/2020/01/28/%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%90%E7%BB%B4/%E5%AE%9E%E9%AA%8C%E5%AE%A4%E8%BF%90%E7%BB%B4%E6%96%87%E6%A1%A3/index.html">
<meta property="og:site_name" content="博客">
<meta property="og:description" content="引言你是否因为python环境杂乱而苦恼，是否因为程序依赖库的半杯不一样而频繁卸载库，是否因为环境问题不停的切换目录等那么你看完这篇文件就能解决你的这些烦恼，小编来讲解linux下多个python环境应该怎么管理 1：工具安装virtualenv是python开发中一个重要的工具,它可以帮助我们创建一个干净的python解释环境，打开控制台安装virtualenv 1pip install vir">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://shark-yun.gitee.io/blog/img/%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%90%E7%BB%B4/linux%E5%91%BD%E4%BB%A4/theme.jpg">
<meta property="article:published_time" content="2020-01-28T08:30:06.000Z">
<meta property="article:modified_time" content="2021-02-27T10:04:24.087Z">
<meta property="article:author" content="小魂">
<meta property="article:tag" content="服务器">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://shark-yun.gitee.io/blog/img/%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%90%E7%BB%B4/linux%E5%91%BD%E4%BB%A4/theme.jpg"><link rel="shortcut icon" href="/blog/img/favicon.png"><link rel="canonical" href="https://shark-yun.gitee.io/blog/2020/01/28/%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%90%E7%BB%B4/%E5%AE%9E%E9%AA%8C%E5%AE%A4%E8%BF%90%E7%BB%B4%E6%96%87%E6%A1%A3/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/blog/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/blog/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isanchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = { 
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2021-02-27 18:04:24'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    })(window)</script><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome/css/font-awesome.min.css"> <script src="/blog/live2d-widget/autoload.js"></script><meta name="generator" content="Hexo 5.4.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="author-avatar"><img class="avatar-img" src="/blog/img/style/touxiang.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/blog/archives/"><div class="headline">文章</div><div class="length-num">26</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/blog/tags/"><div class="headline">标签</div><div class="length-num">14</div></a></div></div></div><hr/></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('/blog/img/%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%90%E7%BB%B4/linux%E5%91%BD%E4%BB%A4/theme.jpg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/blog/">博客</a></span><div id="menus"><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">实验室运维文档</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2020-01-28T08:30:06.000Z" title="发表于 2020-01-28 16:30:06">2020-01-28</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2021-02-27T10:04:24.087Z" title="更新于 2021-02-27 18:04:24">2021-02-27</time></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h1 id="引言"><a href="#引言" class="headerlink" title="引言"></a>引言</h1><p>你是否因为python环境杂乱而苦恼，是否因为程序依赖库的半杯不一样而频繁卸载库，是否因为环境问题不停的切换目录等<br>那么你看完这篇文件就能解决你的这些烦恼，小编来讲解linux下多个python环境应该怎么管理</p>
<h1 id="1：工具安装"><a href="#1：工具安装" class="headerlink" title="1：工具安装"></a>1：工具安装</h1><p>virtualenv是python开发中一个重要的工具,它可以帮助我们创建一个干净的python解释环境，打开控制台安装virtualenv</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pip install virtualenv</span><br></pre></td></tr></table></figure>
<h1 id="2：创建不同python版本环境"><a href="#2：创建不同python版本环境" class="headerlink" title="2：创建不同python版本环境"></a>2：创建不同python版本环境</h1><p>virtualenv创建python版本往往是系统默认的2.x版本.别急,我们只需要一条简单的命令就可以创建一个python3.x的虚拟环境</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">virtualenv -p &#x2F;usr&#x2F;bin&#x2F;python3 name</span><br></pre></td></tr></table></figure>
<p><code>/usr/bin/python3</code>是linux系统中对python3版本建立的软连接路径，name就是我们的python环境的名称了，注意,前提是你已经安装了python3.x版本</p>
<h1 id="3：进入环境"><a href="#3：进入环境" class="headerlink" title="3：进入环境"></a>3：进入环境</h1><p>激活虚拟环境，我们需要打开控制台移动到创建虚拟环境的文件夹下，执行命令</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">source env_name&#x2F;bin&#x2F;activate</span><br></pre></td></tr></table></figure>
<p>source命令是bash shell的内置命令。而点命令（即“.”命令）则是source的另一名称。这两个命令都以一个脚本为参数，该脚本将作为当前shell的环境执行，即不会启动一个新的子进程。</p>
<p><img src="%E5%88%87%E6%8D%A2%E7%8E%AF%E5%A2%83.png" alt="切换环境"></p>
<p>当出现红框框的时候就说明已经进入虚拟环境了，此时用pip安装的所有的包都在这个环境里面</p>
<h1 id="4：批量安装包"><a href="#4：批量安装包" class="headerlink" title="4：批量安装包"></a>4：批量安装包</h1><p>当我们进入虚拟环境的时候，每次安装包都要输一遍pip命令，是不是感觉好麻烦呢，我们可以写一个txt文件，把所有我们要装的包都放到这个txt文件上，甚至可以指定版本</p>
<p><img src="%E5%8C%85.png" alt="包"></p>
<p>现在我们只需要执行</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pip install -r requirements.txt</span><br></pre></td></tr></table></figure>
<p>就能自动全部下载txt下的包了</p>
<h1 id="5：退出环境"><a href="#5：退出环境" class="headerlink" title="5：退出环境"></a>5：退出环境</h1><p>只要使用<code>deactivate</code>就可以退出当前的环境了</p>
<h1 id="6：编写shell脚本自动配置环境"><a href="#6：编写shell脚本自动配置环境" class="headerlink" title="6：编写shell脚本自动配置环境"></a>6：编写shell脚本自动配置环境</h1><p>Shell也是一门编程语言，即shell脚本，shell是解释执行的脚本语言，可直接调用linux命令。</p>
<p>比如我想在home/python3文件夹下建立一个python3环境，名字为py3env，并自动安装requirements.txt文件的flask等库</p>
<p><img src="shell%E8%84%9A%E6%9C%AC%E4%BB%A3%E7%A0%81.png" alt="shell脚本代码"></p>
<p>我们就可以写这样的一个shell脚本代码<br>第一行：第一行的内容指定了shell脚本解释器的路径，而且这个指定路径只能放在文件的第一行。第一行写错或者不写时，系统会有一个默认的解释器进行解释。<br>不要以为第一行加了注释就没有用</p>
<p>第三行：linux的切换路径的命令</p>
<p>第四行：创建python3的虚拟环境</p>
<p>第五行：激活环境</p>
<p>第九行：批量安装环境</p>
<p>下面我们来运行这个脚本</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">source py3env.sh</span><br></pre></td></tr></table></figure>
<p>py3env.sh是脚本文件</p>
<p><img src="shell%E8%84%9A%E6%9C%AC%E8%BF%90%E8%A1%8C%E7%BB%93%E6%9E%9C.png" alt="shell脚本运行结果"></p>
<p>甚至我们可以编写脚本定时启动文件等，shell脚本写的好的话能够给我们的运维工作方便不少，方便大量的环境配置等工作。</p>
<hr>
<p>如果本文对你有巨大的帮助的话，可以在下面打赏一包辣条哦！不甚感激💗</p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">小魂</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://shark-yun.gitee.io/blog/2020/01/28/%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%90%E7%BB%B4/%E5%AE%9E%E9%AA%8C%E5%AE%A4%E8%BF%90%E7%BB%B4%E6%96%87%E6%A1%A3/">https://shark-yun.gitee.io/blog/2020/01/28/%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%90%E7%BB%B4/%E5%AE%9E%E9%AA%8C%E5%AE%A4%E8%BF%90%E7%BB%B4%E6%96%87%E6%A1%A3/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://shark-yun.gitee.io/blog" target="_blank">博客</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/blog/tags/%E6%9C%8D%E5%8A%A1%E5%99%A8/">服务器</a></div><div class="post_share"><div class="social-share" data-image="/blog/img/%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%90%E7%BB%B4/linux%E5%91%BD%E4%BB%A4/theme.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><div class="post-reward"><div class="reward-button button--animated"><i class="fas fa-qrcode"></i> 打赏</div><div class="reward-main"><ul class="reward-all"><li class="reward-item"><a href="/blog/" target="_blank"><img class="post-qr-code-img" src="/blog/"/></a><div class="post-qr-code-desc"></div></li><li class="reward-item"><a href="/blog/" target="_blank"><img class="post-qr-code-img" src="/blog/"/></a><div class="post-qr-code-desc"></div></li></ul></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/blog/2020/01/28/%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%90%E7%BB%B4/%E7%AE%A1%E7%90%86python%E7%8E%AF%E5%A2%83/"><img class="prev-cover" src="/blog/img/%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%90%E7%BB%B4/linux%E5%91%BD%E4%BB%A4/theme.jpg" onerror="onerror=null;src='/blog/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">管理python环境</div></div></a></div><div class="next-post pull-right"><a href="/blog/2020/01/16/css3%E5%A4%87%E5%BF%98%E5%BD%95/css3/"><img class="next-cover" src="/blog/img/%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%90%E7%BB%B4/nginx%E5%AE%89%E8%A3%85/theme.jpg" onerror="onerror=null;src='/blog/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">css3备忘录</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span> 相关推荐</span></div><div class="relatedPosts-list"><div><a href="/blog/2019/12/30/服务器运维/python3安装/" title="linux系统python2和python3"><img class="cover" src="/blog/img/%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%90%E7%BB%B4/python3/theme.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2019-12-30</div><div class="title">linux系统python2和python3</div></div></a></div><div><a href="/blog/2019/12/30/服务器运维/nginx安装/" title="nginx安装"><img class="cover" src="/blog/img/%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%90%E7%BB%B4/nginx%E5%AE%89%E8%A3%85/theme.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2019-12-30</div><div class="title">nginx安装</div></div></a></div><div><a href="/blog/2019/12/30/服务器运维/mysql安装/" title="mysql安装"><img class="cover" src="/blog/img/%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%90%E7%BB%B4/mysql%E5%AE%89%E8%A3%85/theme.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2019-12-30</div><div class="title">mysql安装</div></div></a></div><div><a href="/blog/2019/12/30/服务器运维/linux命令/" title="linux命令"><img class="cover" src="/blog/img/%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%90%E7%BB%B4/linux%E5%91%BD%E4%BB%A4/theme.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2019-12-30</div><div class="title">linux命令</div></div></a></div><div><a href="/blog/2020/01/28/服务器运维/管理python环境/" title="管理python环境"><img class="cover" src="/blog/img/%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%90%E7%BB%B4/linux%E5%91%BD%E4%BB%A4/theme.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-01-28</div><div class="title">管理python环境</div></div></a></div><div><a href="/blog/2020/06/20/数据库/orcal数据库时间设置问题/" title="orcal数据库时间设置问题"><img class="cover" src="/blog/img/orcal%E6%95%B0%E6%8D%AE%E5%BA%93%E6%97%B6%E9%97%B4%E8%AE%BE%E7%BD%AE%E9%97%AE%E9%A2%98/index.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-06-20</div><div class="title">orcal数据库时间设置问题</div></div></a></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="card-info-avatar is-center"><img class="avatar-img" src="/blog/img/style/touxiang.jpg" onerror="this.onerror=null;this.src='/blog/img/friend_404.gif'" alt="avatar"/><div class="author-info__name">小魂</div><div class="author-info__description"></div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/blog/archives/"><div class="headline">文章</div><div class="length-num">26</div></a></div><div class="card-info-data-item is-center"><a href="/blog/tags/"><div class="headline">标签</div><div class="length-num">14</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/xxxxxx"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://gitee.com/shangxiaohun/dashboard/projects" target="_blank" title="Github"><i class="fa fa-github"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%BC%95%E8%A8%80"><span class="toc-number">1.</span> <span class="toc-text">引言</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#1%EF%BC%9A%E5%B7%A5%E5%85%B7%E5%AE%89%E8%A3%85"><span class="toc-number">2.</span> <span class="toc-text">1：工具安装</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#2%EF%BC%9A%E5%88%9B%E5%BB%BA%E4%B8%8D%E5%90%8Cpython%E7%89%88%E6%9C%AC%E7%8E%AF%E5%A2%83"><span class="toc-number">3.</span> <span class="toc-text">2：创建不同python版本环境</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#3%EF%BC%9A%E8%BF%9B%E5%85%A5%E7%8E%AF%E5%A2%83"><span class="toc-number">4.</span> <span class="toc-text">3：进入环境</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#4%EF%BC%9A%E6%89%B9%E9%87%8F%E5%AE%89%E8%A3%85%E5%8C%85"><span class="toc-number">5.</span> <span class="toc-text">4：批量安装包</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#5%EF%BC%9A%E9%80%80%E5%87%BA%E7%8E%AF%E5%A2%83"><span class="toc-number">6.</span> <span class="toc-text">5：退出环境</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#6%EF%BC%9A%E7%BC%96%E5%86%99shell%E8%84%9A%E6%9C%AC%E8%87%AA%E5%8A%A8%E9%85%8D%E7%BD%AE%E7%8E%AF%E5%A2%83"><span class="toc-number">7.</span> <span class="toc-text">6：编写shell脚本自动配置环境</span></a></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/blog/2021/04/21/%E6%98%BE%E7%A4%BA%E5%99%A8/xianshiqi/" title="Linux开启显示器内置声卡"><img src="/blog/img/%E6%98%BE%E7%A4%BA%E5%99%A8/picture/index.png" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="Linux开启显示器内置声卡"/></a><div class="content"><a class="title" href="/blog/2021/04/21/%E6%98%BE%E7%A4%BA%E5%99%A8/xianshiqi/" title="Linux开启显示器内置声卡">Linux开启显示器内置声卡</a><time datetime="2021-04-21T05:08:50.000Z" title="发表于 2021-04-21 13:08:50">2021-04-21</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/2021/02/09/%E6%95%99%E7%A8%8B/%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87/" title="环境准备"><img src="/blog/img/%E5%A6%82%E4%BD%95%E4%BC%98%E9%9B%85%E7%9A%84%E5%86%99%E5%87%BApython%E4%BB%A3%E7%A0%81/%E5%A6%82%E4%BD%95%E4%BC%98%E9%9B%85%E7%9A%84%E5%86%99%E5%87%BApython%E4%BB%A3%E7%A0%81/index.png" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="环境准备"/></a><div class="content"><a class="title" href="/blog/2021/02/09/%E6%95%99%E7%A8%8B/%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87/" title="环境准备">环境准备</a><time datetime="2021-02-09T02:59:50.000Z" title="发表于 2021-02-09 10:59:50">2021-02-09</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/2021/02/07/%E6%95%99%E7%A8%8B/%E5%88%86%E6%9E%90%E5%BB%BA%E5%BA%93%E5%87%86%E5%A4%87%E5%B7%A5%E4%BD%9C/" title="分析建库准备工作"><img src="/blog/img/%E5%A6%82%E4%BD%95%E4%BC%98%E9%9B%85%E7%9A%84%E5%86%99%E5%87%BApython%E4%BB%A3%E7%A0%81/%E5%A6%82%E4%BD%95%E4%BC%98%E9%9B%85%E7%9A%84%E5%86%99%E5%87%BApython%E4%BB%A3%E7%A0%81/index.png" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="分析建库准备工作"/></a><div class="content"><a class="title" href="/blog/2021/02/07/%E6%95%99%E7%A8%8B/%E5%88%86%E6%9E%90%E5%BB%BA%E5%BA%93%E5%87%86%E5%A4%87%E5%B7%A5%E4%BD%9C/" title="分析建库准备工作">分析建库准备工作</a><time datetime="2021-02-07T08:15:50.000Z" title="发表于 2021-02-07 16:15:50">2021-02-07</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/2020/09/27/%E9%80%81%E7%BB%99%E5%B0%8F%E5%AD%A6%E5%BC%9F%E7%9A%84%E4%B8%80%E5%B0%81%E4%BF%A1/%E9%80%81%E7%BB%99%E5%B0%8F%E5%AD%A6%E5%BC%9F%E7%9A%84%E4%B8%80%E5%B0%81%E4%BF%A1/" title="送给小学弟的一封信"><img src="/blog/img/%E5%A6%82%E4%BD%95%E4%BC%98%E9%9B%85%E7%9A%84%E5%86%99%E5%87%BApython%E4%BB%A3%E7%A0%81/%E5%A6%82%E4%BD%95%E4%BC%98%E9%9B%85%E7%9A%84%E5%86%99%E5%87%BApython%E4%BB%A3%E7%A0%81/index.png" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="送给小学弟的一封信"/></a><div class="content"><a class="title" href="/blog/2020/09/27/%E9%80%81%E7%BB%99%E5%B0%8F%E5%AD%A6%E5%BC%9F%E7%9A%84%E4%B8%80%E5%B0%81%E4%BF%A1/%E9%80%81%E7%BB%99%E5%B0%8F%E5%AD%A6%E5%BC%9F%E7%9A%84%E4%B8%80%E5%B0%81%E4%BF%A1/" title="送给小学弟的一封信">送给小学弟的一封信</a><time datetime="2020-09-26T18:20:50.000Z" title="发表于 2020-09-27 02:20:50">2020-09-27</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/2020/07/11/%E5%82%85%E7%AB%8B%E5%8F%B6%E5%8F%98%E6%8D%A2/%E5%82%85%E7%AB%8B%E5%8F%B6%E5%8F%98%E6%8D%A2/" title="傅立叶变换"><img src="/blog/img/opencv/opencv_split_img/opencv_split_img_style.jpg" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="傅立叶变换"/></a><div class="content"><a class="title" href="/blog/2020/07/11/%E5%82%85%E7%AB%8B%E5%8F%B6%E5%8F%98%E6%8D%A2/%E5%82%85%E7%AB%8B%E5%8F%B6%E5%8F%98%E6%8D%A2/" title="傅立叶变换">傅立叶变换</a><time datetime="2020-07-11T15:53:50.000Z" title="发表于 2020-07-11 23:53:50">2020-07-11</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2021 By 小魂</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">你只管努力，剩下的交给时间</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/blog/js/utils.js"></script><script src="/blog/js/main.js"></script><div class="js-pjax"></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>